<%@ page contentType="text/html; charset=UTF-8" %> 
<%@page import="net.zhnb.util.*"%>
<%@ page import="net.zhnb.bean.*"%>
<%@ page import="java.util.*" %>
<%@page import="finaler.util.PageList"%>
<%@page import="finaler.util.PageUtil"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<jsp:include page="adminImport.jsp"/>
</head>
<% PageList roomList =  (PageList) request.getAttribute("roomList"); %>

<script>
	function checkForm(){
		if($("#roomname").val()==''){
			alert("请输入场馆名称!");
			return false;
		}
	}
	function del(id){
		if(confirm("确定吗!")){
			var url =  "<%=Constants.URL%>/admin/roomDel_"+id;
			window.location = url;
		}
	}
</script>

<body>

<a href="<%=Constants.URL %>/admin/menu">返回</a><br/><br/>


<!-- Table goes in the document BODY -->
<table class="hovertable">
	<tr>
	    <th>场馆id</th><th>场馆名称</th><th>场馆地址</th><th>场馆电话</th><th>修改</th><th>删除</th>
	</tr>
	<%
	for( int i=0;i<roomList.getList().size();i++){
		Room room = (Room) roomList.getList().get(i);
	%>
		<tr align="center" onmouseover="this.style.backgroundColor='#ffffff';" onmouseout="this.style.backgroundColor='#d4e3e5';">
		    <td><%=room.getId()%></td>
		    <td><%=room.getRoomname()%></td>
		    <td><%=room.getRoomaddress()%></td>
		    <td><%=room.getRoomtel()%></td>
		    <td><a href="<%=Constants.URL %>/admin/roomModi_<%=room.getId()%>">修改</a></td>
		    <td><a href="###" onclick="del('<%=room.getId()%>')">删除</a></td>
		</tr>
	<%} %>
		<tr>
		    <td colspan="6">
				<%=PageUtil.getCurrPage(roomList)%>
				<%=PageUtil.getRecord(roomList)%>
				<%=PageUtil.getSinglePaginator(roomList,false)%>
		    </td>
		</tr>
</table>

<br/><br/>

<form action="<%=Constants.URL %>/admin/roomAdd" method="post" onsubmit="return checkForm()">
	场馆名称<font color="red">*</font>:<input type="input" name="roomname" id="roomname"/><br/>
	场馆地址:<input type="input" name="roomaddress" id="roomaddress"/><br/>
	场馆电话:<input type="input" name="roomtel" id="roomtel"/><br/>
	<input type="submit" value="增加"/>
</form>

</body>
</html>